package com.qjcc.controller;

import com.qjcc.domain.AjaxJson;
import com.qjcc.service.CallCenterService;
import com.qjcc.service.QjztService;
import com.qjcc.service.ZtTableDataNewService;
import com.qjcc.service.ZtTableDataService;
import com.qjcc.util.SQLServerDataSourceFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

@RestController
@RequestMapping("/qjzt")
public class QjztController {

    @Autowired
    private QjztService qjztService;

    @Autowired
    private CallCenterService callCenterService;

    @Autowired
    private ZtTableDataService ztTableDataService;

    @Autowired
    private ZtTableDataNewService ztTableDataNewService;

    @RequestMapping("/data")
    public AjaxJson data() {
        return qjztService.data();
    }

    @RequestMapping("/mapData")
    public AjaxJson mapData() {
        return qjztService.mapData();
    }

    @RequestMapping("/mapDataProvince")
    public AjaxJson mapDataProvince(String provinceName) {
        return qjztService.mapDataDrilldown(provinceName);
    }

    @RequestMapping("/whl/{queryType}")
    public AjaxJson whl(@PathVariable("queryType") String queryType) {
        return ztTableDataNewService.whl(queryType);
    }

    @RequestMapping("/cb/{queryType}")
    public AjaxJson cb(@PathVariable("queryType") String queryType) {
        return ztTableDataNewService.cb(queryType);
    }

    @RequestMapping("/gz/{queryType}")
    public AjaxJson gz(@PathVariable("queryType") String queryType) {
        return ztTableDataNewService.gz(queryType);
    }

    @RequestMapping("/gzcz/{queryType}")
    public AjaxJson gzcz(@PathVariable("queryType") String queryType) {
        return ztTableDataNewService.gzcz(queryType);
    }

    @RequestMapping("/call")
    public AjaxJson call() {
        return callCenterService.call();
    }

    @RequestMapping("/workcard")
    public AjaxJson workcard() {
        return callCenterService.workcard();
    }

    @RequestMapping("/report")
    public AjaxJson report() {
        return callCenterService.report();
    }

    @RequestMapping("/sign")
    public AjaxJson sign() {
        return callCenterService.sign();
    }

}
